package com.hzit.controller;

import com.hzit.anno.RequiresPermissions;
import com.hzit.entity.Classes;
import com.hzit.mapper.ClassesMapper;
import com.hzit.service.ClassesService;
import com.hzit.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 作者：李嘉浩
 * 时间：2024-08-22-19:57
 * 功能：
 */

@RestController
@RequestMapping("/api/classes")
@Api("班级信息")

public class ClassesController {
    @Autowired
    private ClassesService service;

    @GetMapping("/list")
    @ApiOperation("查询所有班级")
    @RequiresPermissions("classes:list")
    public R list(){
        List<Classes> list = service.list();
        return R.ok().data("list",list);
    }
}
